<%@page language="java" pageEncoding="utf-8" %>
<%@ page contentType="text/html;charset=utf-8" %>
<%@ page import="hb.*"  import="java.util.*"%>
<%@ page session="true" %>

<%
	Iterator houseIter=(Iterator)session.getAttribute("houseList");
	Iterator needIter=(Iterator)session.getAttribute("needList");
	String service=(String)session.getAttribute("service");
	String district=(String)session.getAttribute("district");
	String rent=(String)session.getAttribute("rent");
	String room=(String)session.getAttribute("room");
%>


<html>
<head>
<title>我要租！我要住！！！</title>
<style type="text/css">
<!--
.toppage {	font-size: x-large;
	line-height: normal;
	font-weight: bold;
	text-decoration: underline;
	color: #FFFF33;
}
body {
	background-image: url(image/background.gif);
	background-repeat: repeat;
}
#Layer9 {
	position:absolute;
	left:300px;
	top:117px;
	width:600px;
	height:74px;
	z-index:6;
	background-color: #FFFFFF;
}
.条件 {
	font-family: "微软雅黑";
	font-size: large;
	font-style: normal;
	font-weight: normal;
	color: #333333;
}
.选项 {
	font-family: "宋体";
	font-size: medium;
	font-style: normal;
	font-weight: normal;
	font-variant: normal;
	color: #0000FF;
}
.已选 {
	font-family: "宋体";
	font-size: medium;
	font-style: normal;
	font-weight: bold;
	font-variant: normal;
	color: #333333;
	text-decoration: underline;
}
.STYLE4 {font-family: "微软雅黑"; font-size: 50px; font-style: normal; font-weight: bold; font-variant: normal; color: #FF6633; }
#Layer4 {	position:absolute;
	left:300px;
	top:16px;
	width:600px;
	height:95px;
	z-index:2;
	background-image: url(image/page01_04.jpg);
	visibility: visible;
}
.STYLE1 {	font-family: "宋体";
	color: #0000FF;
	text-decoration: underline;
}
#Layer1 {	position:absolute;
	left:887px;
	top:18px;
	width:185px;
	height:21px;
	z-index:1;
}
#Layer2 {
	position:absolute;
	left:9px;
	top:319px;
	width:138px;
	height:26px;
	z-index:7;
}
#Layer3 {
	position:absolute;
	left:177px;
	top:215px;
	width:850px;
	height:28px;
	z-index:7;
	visibility: visible;
	background-color: #00CCFF;
}
.STYLE9 {font-family: "微软雅黑"; font-size: large; font-style: normal; font-weight: bold; font-variant: normal; color: #FF6633; }
#Layer5 {
	position:absolute;
	left:177px;
	top:264px;
	width:850px;
	height:56px;
	z-index:8;
	background-color: #FFFFFF;
}
.STYLE12 {font-style: normal; font-weight: bold; font-variant: normal; color: #333333; text-decoration: underline; font-family: "宋体";}
.STYLE13 {font-family: "微软雅黑"; font-size: small; font-style: normal; font-weight: normal; color: #333333; }
.STYLE14 {font-family: "宋体"; font-size: small; font-style: normal; font-weight: normal; font-variant: normal; color: #0000FF; }
.STYLE16 {font-size: small; font-family: "宋体"; font-style: normal; font-weight: bold; font-variant: normal; text-decoration: none; }
.STYLE17 {font-family: "微软雅黑"; font-size: small; font-style: normal; font-weight: bold; font-variant: normal; color: #FF6633; }
.STYLE18 {font-family: "宋体"; font-style: normal; font-variant: normal; text-decoration: none; font-size: small;}
-->
</style>
<script type="text/JavaScript">
<!--
function MM_goToURL() { //v3.0
  var i, args=MM_goToURL.arguments; document.MM_returnValue = false;
  for (i=0; i<(args.length-1); i+=2) eval(args[i]+".location='"+args[i+1]+"'");
}
//-->
</script>
</head>

<body>

<div id="Layer9">
<form action="/zhuzhuwang/Controller?action=search" method="post"  target="_self" name="searchDetail" id="searchDetail">
    <table width="100%" height="22%" border="0" align="center">
      <tr>
        <td width="104" height="37" align="right" class="STYLE13"> 按区域租房：</td>
         <td width="118" class="STYLE11"><select name="district" class="STYLE10" id="district">
           <option value="1"<%if(district.equals("1")){%>
           selected="selected"<%} %>>黄浦</option>
           <option value="2"<%if(district.equals("2")){%>
           selected="selected"<%} %>>卢湾</option>
           <option value="3"<%if(district.equals("3")){%>
           selected="selected"<%} %>>静安</option>
           <option value="4"<%if(district.equals("4")){%>
           selected="selected"<%} %>>徐汇</option>
           <option value="5"<%if(district.equals("5")){%>
           selected="selected"<%} %>>浦东</option>
           <option value="6"<%if(district.equals("6")){%>
           selected="selected"<%} %>>长宁</option>
           <option value="7"<%if(district.equals("7")){%>
           selected="selected"<%} %>>虹口</option>
           <option value="8"<%if(district.equals("8")){%>
           selected="selected"<%} %>>杨浦</option>
           <option value="9"<%if(district.equals("9")){%>
           selected="selected"<%} %>>普陀</option>
           <option value="10"<%if(district.equals("10")){%>
           selected="selected"<%} %>>闸北</option>
           <option value="11"<%if(district.equals("11")){%>
           selected="selected"<%} %>>闵行</option>
           <option value="12"<%if(district.equals("12")){%>
           selected="selected"<%} %>>宝山</option>
           <option value="13"<%if(district.equals("13")){%>
           selected="selected"<%} %>>嘉定</option>
           <option value="14"<%if(district.equals("14")){%>
           selected="selected"<%} %>>青浦</option>
           <option value="15"<%if(district.equals("15")){%>
           selected="selected"<%} %>>奉贤</option>
           <option value="16"<%if(district.equals("16")){%>
           selected="selected"<%} %>>南汇</option>
           <option value="17"<%if(district.equals("17")){%>
           selected="selected"<%} %>>崇明</option>
           <option value="18"<%if(district.equals("18")){%>
           selected="selected"<%} %>>金山</option>
           <option value="19" <%if(district.equals("19")){%>
           selected="selected"<%} %>>松江</option>
           <option value="0" 
           <%if(district.equals("0")||district==null){%>
           selected="selected"<%} %>>全上海</option>
        </select></td>
         <td width="106" align="right" class="STYLE11"><span class="STYLE13">按租金租房： </span></td>
         <td colspan="2" class="STYLE11"><select name="rent" class="STYLE10" id="select">
           <option value="1"<%if(rent.equals("1")){%>
           selected="selected"<%} %>>500以下</option>
           <option value="2"<%if(rent.equals("2")){%>
           selected="selected"<%} %>>500-1000</option>
           <option value="3"<%if(rent.equals("3")){%>
           selected="selected"<%} %>>1000-2000</option>
           <option value="4"<%if(rent.equals("4")){%>
           selected="selected"<%} %>>2000-3000</option>
           <option value="5"<%if(rent.equals("5")){%>
           selected="selected"<%} %>>3000-4000</option>
           <option value="6"<%if(rent.equals("6")){%>
           selected="selected"<%} %>>4000-6000</option>
           <option value="7"<%if(rent.equals("7")){%>
           selected="selected"<%} %>>6000以上</option>
           <option value="0" <%if(rent.equals("0")||rent==null){%>
           selected="selected"<%} %>>不限</option>
        </select></td>
      </tr>
      <tr>
        <td align="right" class="STYLE13">按居室租房：</td>
         <td width="118" class="STYLE11"><select name="room" class="STYLE10" id="room">
           <option value="1"<%if(room.equals("1")){%>
           selected="selected"<%} %>>1室</option>
           <option value="2"<%if(room.equals("2")){%>
           selected="selected"<%} %>>2室</option>
           <option value="3"<%if(room.equals("3")){%>
           selected="selected"<%} %>>3室</option>
           <option value="4"<%if(room.equals("4")){%>
           selected="selected"<%} %>>4室及以上</option>
           <option value="0"<%if(room.equals("0")||room==null){%>
           selected="selected"<%} %>>不限</option>
        </select></td>
         <td width="106" align="right" class="STYLE11"><span class="STYLE13">按服务类型：</span></td>
         <td width="108" class="STYLE11"><select name="service" class="STYLE10" id="rent">
           <option value="1"<%if(service.equals("1")){%>
           selected="selected"<%} %>>出租</option>
           <option value="2"<%if(service.equals("2")){%>
           selected="selected"<%} %>>求租</option>
           <option value="0"<%if(service.equals("0")||service==null){%>
           selected="selected"<%} %>>不限</option>
        </select></td>  
         <td width="149" class="STYLE11"><span class="STYLE15">
           <input name="SubmitName" type="submit" class="STYLE13" value="搜一下" />
         </span></td>
      </tr>
  </table>
  </form>
</div>
<div id="Layer4" onClick="MM_goToURL('parent','/zhuzhuwang/index.jsp');return document.MM_returnValue" style="background-image:url(image/titile.jpg)">
  <table width="200" border="0" align="center">
    <tr>
      <td height="89" align="center" valign="middle" class="STYLE4">住住网</td>
    </tr>
  </table>
</div>
<div id="Layer1">
  <table width="100%" border="0">

  <%if(session.getAttribute("user")==null) {%>
    <tr>
      <td width="73" align="right" onClick="MM_showHideLayers('Layer3','','show')"><span class="STYLE1" onClick="MM_showHideLayers('Layer3','','show')" onDblClick="MM_showHideLayers('Layer3','','hide')"><a href="/zhuzhuwang/login.jsp" target="_self">登录</a></span></td>
      <td width="10" align="left">|</td>
      <td width="88" align="left"><a href="/zhuzhuwang/reg.jsp" target="_self">注册</a></td>
    </tr>
    <%} else{%>
    <tr>
      <td width="73" align="right" ><a href="/zhuzhuwang/userspace.jsp" target="_self"><%=session.getAttribute("user") %></td>
      <td width="10" align="left">|</td>
      <td width="88" align="left"><a href="/zhuzhuwang/Controller?action=logout">退出</a></td>
   <%
    } 
   %>
   </tr>
  </table>
</div>
<div class="STYLE9" id="Layer3">房屋信息</div>
<div id="Layer5">
  <table width="100%" height="100%" border="0">
    <tr>
      <th width="10%" align="center" valign="middle" scope="col"><span class="STYLE16">类型</span></th>
      <th width="20%" align="left" valign="middle" scope="col"><span class="STYLE16">房租</span></th>
      <th width="25%" align="left" valign="middle" scope="col"><span class="STYLE16">居室</span></th>
      <th width="30%" align="left" valign="middle" scope="col"><span class="STYLE16">地址</span></th>
      <th width="15%" align="left" valign="middle" scope="col"><span class="STYLE16">上传时间</span></th>
    </tr>
    <%
    boolean h=false;
    boolean n=false;
    House house=new House();
    AskRentList need=new AskRentList();
    if(houseIter!=null&&needIter!=null){
    while(needIter.hasNext()&&(service.equals("2")||service.equals("0"))){ 
    	need=(AskRentList)needIter.next();
    	if(need.getStatus()==0){
    %>
    <tr>
      <td width="10%" align="center" valign="middle" class="STYLE17" scope="col">求租</td>
      <td width="20%" align="left" valign="middle" class="STYLE18" scope="col"><span class="STYLE17"><%=need.getRent() %></span>元/月</td>
      <td width="25%" align="left" valign="middle" class="STYLE18" scope="col"><%=need.getBedroom() %>室<%=need.getSittingroom() %>厅<%=need.getToilet() %>卫 </td>
      <td width="30%" align="left" valign="middle" scope="col"><a href="/zhuzhuwang/askrentitem.jsp?listID=<%=need.getListId() %>" target="_self">
      <%
      String rgn=null;
      switch(Integer.parseInt(need.getRegion())){
      case 1:rgn="黄浦";break;
      case 2:rgn="卢湾";break;
      case 3:rgn="静安";break;
      case 4:rgn="徐汇";break;
      case 5:rgn="浦东";break;
      case 6:rgn="长宁";break;
      case 7:rgn="虹口";break;
      case 8:rgn="杨浦";break;
      case 9:rgn="普陀";break;
      case 10:rgn="闸北";break;
      case 11:rgn="闵行";break;
      case 12:rgn="宝山";break;
      case 13:rgn="嘉定";break;
      case 14:rgn="青浦";break;
      case 15:rgn="奉贤";break;
      case 16:rgn="南汇";break;
      case 17:rgn="崇明";break;
      case 18:rgn="金山";break;
      case 19:rgn="松江";break;
      default:rgn="全上海";break;
      } %>
      <%=rgn %></a></td>
      <td width="15%" align="left" valign="middle" scope="col"><%=need.getDate() %></td>
    </tr>
    <%}}%>
    
    
    
    
    <% while(houseIter.hasNext()&&(service.equals("1")||service.equals("0"))){
    	
    house=(House)houseIter.next();

    if(house.getStatus()==0){ %>
    <tr>
      <td width="10%" align="center" valign="middle" class="STYLE17" scope="col">出租</td>
      <td width="20%" align="left" valign="middle" class="STYLE18" scope="col"><span class="STYLE17"><%=house.getRent() %></span>元/月</td>
      <td width="25%" align="left" valign="middle" class="STYLE18" scope="col"><%=house.getBedroom() %>室<%=house.getSittingroom() %>厅<%=house.getToilet() %>卫 <%=house.getSquare() %>平方米 </td>
      <td width="30%" align="left" valign="middle" scope="col"><a href="/zhuzhuwang/Controller?action=houseItem&houseID=<%= house.getHouseId() %>" target="_self">
      <%
      String rgn=null;
      switch(Integer.parseInt(house.getRegion())){
      case 1:rgn="黄浦";break;
      case 2:rgn="卢湾";break;
      case 3:rgn="静安";break;
      case 4:rgn="徐汇";break;
      case 5:rgn="浦东";break;
      case 6:rgn="长宁";break;
      case 7:rgn="虹口";break;
      case 8:rgn="杨浦";break;
      case 9:rgn="普陀";break;
      case 10:rgn="闸北";break;
      case 11:rgn="闵行";break;
      case 12:rgn="宝山";break;
      case 13:rgn="嘉定";break;
      case 14:rgn="青浦";break;
      case 15:rgn="奉贤";break;
      case 16:rgn="南汇";break;
      case 17:rgn="崇明";break;
      case 18:rgn="金山";break;
      case 19:rgn="松江";break;
      default:rgn="全上海";break;
      } %>
      <%=rgn %>
      <%=house.getEstate() %></a></td>
      <td width="15%" align="left" valign="middle" scope="col"><%=house.getDate() %></td>
    </tr>
     <%}}}%>
  </table>
</div>
</body>

</html>
